#!/bin/bash

echoo()
{
    echo echoo: \$1=$1
}

echo \$0=$0
echo \$1=$1
echo \$2=$2
false; echo false: \$?=$?
true; echo true: \$?=$?
(exit -3); echo exit -3: \$?=$?
echo \$\#=$#
echo \$\$=$$
echo \$\*=$*
echo \"\$\*\"="$*"
echoo $*
echoo "$*"
echo \$-=$-

file=$(pwd)/$0
echo file: $file
echo 1: ${file}.out
echo 2: ${file#*/}
echo 3: ${file##*/}
echo 4: ${file#*.}
echo 5: ${file##*.}
echo 6: ${file%/*}
echo 7: ${file%%/*}
echo 8: ${file%.*}
echo 9: ${file%%.*}
echo 0:5 ${file:0:5}
echo 5:5 ${file:5:5}
echo 5:-5 ${file:5:-5}
echo \#: ${#file}

if [ "$1" = "" ]; then
    default1=
    default2=
fi
default1=${default1-1}
default2=${default2:-2}
echo default1: $default1
echo default2: $default2

echo \${\!\$1}=\$$1=${!1}
